package com.wasion.pwportable.protocol.analyzer.terminal;

import com.wasion.pwportable.protocol.Result;
import com.wasion.pwportable.protocol.analyzer.AbstractAnalyzer;

public class NetWork_Start_Analyzer extends AbstractAnalyzer {

	@Override
	public void dataAnalysis(String ackBS) {
		String dataType = ackBS.substring(DATATPYESTARTBIT, DATATPYENDBIT);
		// String dataLen = ackBS.substring(DATALENGTHSTARTBIT,
		// DATALENGTHENDBIT);

		if (dataType.equalsIgnoreCase("F2")) {
			String actionRely = ackBS.substring(DATABITSTART, DATABITSTART + 2);

			if (actionRely.equalsIgnoreCase("01"))
				result.setActionReply(Result.SUCCESS);
			else
				result.setActionReply(Result.FAILED);
		} else
			result.setActionReply(Result.NO_REPLY);
	}
}
